package com.zs.model;

import java.io.Serializable;
import java.util.List;

/**
 * responseTO,基础返回TO类
 */
public class ResponseCodeEntity implements Serializable {
    
    private static final long serialVersionUID = 3643696267088634953L;

	/**
	 * 返回code
	 */
    private int code=0;
    
    /**
     * 返回提示
     */
    private String msg="success";

	/**
	 * 页数
	 */
	private int pageSize;

	/**
	 * 页码
	 */
	private int pageNo;

	/**
	 * 总页数
	 */
	private int pageCnt;

	/**
	 * 是否下页
	 */
	private int isNext;

	/**
	 * 总记录数
	 */
	private int recordCnt;

	private List<?> dataList;

	private Object data;


	public ResponseCodeEntity(int code, String msg, List dataList, int recordCnt, int pageSize, int pageNo) {
		super();
		this.pageSize=pageSize;
		this.pageNo=pageNo;
		this.dataList = dataList;
		this.code = code;
		this.msg = msg;
		this.recordCnt = recordCnt;

		if(pageSize >= 0) {
			pageCnt=(int)Math.ceil((double)recordCnt / (double)pageSize);
		}
		if(pageCnt>pageNo){
			isNext=1;
		}else {
			isNext=0;
		}
	}

	public ResponseCodeEntity(Object data) {
		this.data = data;
	}
}
